#ifndef __GLBVAR_H
#define __GLBVAR_H

//----------------------------------Include-------------------------------------
#include  <stdint.h>
//------------------------------------------------------------------------------

//-----------------------------------Macro--------------------------------------
#define countof(Obj)  (sizeof(Obj)/sizeof(Obj[0]))
//------------------------------------------------------------------------------
#define BSWAP_16(x) \
        (uint16_t)((((uint16_t)(x) & 0x00ff) << 8) | \
                   (((uint16_t)(x) & 0xff00) >> 8)   \
                  )
#define BSWAP_32(x) \
        (uint32_t)((((uint32_t)(x) & 0xff000000) >> 24) | \
                   (((uint32_t)(x) & 0x00ff0000) >>  8) | \
                   (((uint32_t)(x) & 0x0000ff00) <<  8) | \
                   (((uint32_t)(x) & 0x000000ff) << 24)   \
                  )
//------------------------------------------------------------------------------
#define WAKE_SRC_NO                  0
#define WAKE_SRC_BLE                 1
#define WAKE_SRC_MEAS                2
#define WAKE_SRC_MOVE                3
#define WAKE_SRC_KEY                 4
//------------------------------------------------------------------------------

//-----------------------------------Types--------------------------------------
//------------------------------------------------------------------------------

//---------------------------------Share Var------------------------------------
#ifdef  APP_GLOBALS
#else
extern  uint64_t             igu64_tick_10ms;
extern  uint32_t             gu32_sleep_en;
extern  uint32_t             gu32_wake_utc;
extern  uint32_t             gu32_wake_src;
extern  uint32_t             igu32_move_flag;
extern  uint32_t             igu32_key_flag;
extern  uint32_t             gu32_pswd_root;
extern  uint32_t             gu32_pswd_user;
#endif
//------------------------------------------------------------------------------

#endif
//------------------------------------EOF---------------------------------------

